package com.zyb.controller;

//2.制作控制器类，等同于Servlet
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

//2.1必须是一个spring管理的bean

@Controller
public class UserController {
    //2.3设置当前方法的访问路径
    @RequestMapping("/save")
    //2.4设置响结果为json数据
    @ResponseBody
    //2.2定义具体处理请求的方法
    public String save(){
        System.out.println("user save ...");
        return "{'module':'springmvc save'}";
    }

    @RequestMapping("/delete")
    @ResponseBody
    public String delete(){
        System.out.println("user delete ...");
        return "{'module':'springmvc delete '}";
    }
}
